package Sci.Learn.Lambda;

public class LambdaSample {

    public static void main(String[] args) {
        //1.标准
        MathOperation addition=(Integer a,Integer b)->{
            System.out.println("加法运算");
            return  a+b+0f;
        };
        System.out.println(addition.operate(5,3));
        //2.允许忽略参数类型
        MathOperation substraction=(a,b)->{
            return a-b+0f;
        };
        System.out.println(substraction.operate(5,3));
        //2.单行实现可以省略大括号和return
        MathOperation multiplication=(a,b)->a*b+0f;
        System.out.println(multiplication.operate(5,3));

        MathOperation division=(a,b)->a/b+0f;
        System.out.println(division.operate(6,3));
    }

}
